<?php

namespace App\Http\Controllers\home;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

use DB;

class payController extends Controller
{
    //
    public function index($id){        
        return view('home.doPayb', ['money' => $_GET['money'], 'list' => session('list')]);
    }

    // 立即购买
    public function indexc($pid){    
    $detail = DB::table('detail')->where('id', $pid)->get()->first();
    //地址查询
    $ob = DB::table('address')->get();
    $sum = $detail->price * $_GET['amount'];    
    return view('home.pay', ['detail' => $detail, 'amount' => $_GET['amount'], 'sum' => $sum,'ob'=>$ob]);
    }
}